package com.ysd.lis.controller.qc;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.request.CommonPageDto;
import com.ysd.lis.request.qc.QcInstrItemDto;
import com.ysd.lis.service.qc.QcInstrItemService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 员工表
 * 前端控制器
 * </p>
 *
 * @author LiuQi
 * @since 2023-10-19
 */
@Api(tags = "仪器质控项目")
@RestController
@RequestMapping("/api/qc/qcInstrItem")
public class QcInstrItemController extends BaseController {

    @Autowired
    QcInstrItemService qcInstrItemService;

    @ApiOperation("查询仪器及仪器大类父子结构")
    @GetMapping("/findInstrClassAndInstrList")
    public Result findInstrClassAndInstrList(CommonPageDto pageParam){
        return qcInstrItemService.findInstrClassAndInstrList(pageParam);
    }

    @ApiOperation("查询")
    @GetMapping("/findQcInstrItemList")
    public Result findQcInstrItemList(CommonPageDto pageParam){
        return qcInstrItemService.findQcInstrItemList(pageParam);
    }
    @ApiOperation("批量新增")
    @PostMapping("/batchAddQcInstrItemList")
    public Result batchAddQcInstrItemList(@RequestBody QcInstrItemDto dto){
        return  qcInstrItemService.batchAddQcInstrItemList(dto);
    }
    @ApiOperation("批量更新")
    @PostMapping("/batchUpdateQcInstrItemList")
    public Result batchUpdateQcInstrItemList(@RequestBody QcInstrItemDto dto){
        return  qcInstrItemService.batchUpdateQcInstrItemList(dto);
    }
    @ApiOperation("批量删除")
    @PostMapping("/batchDeleteQcInstrItemList")
    public Result batchDeleteQcInstrItemList(@RequestBody QcInstrItemDto dto){
        return  qcInstrItemService.batchDeleteQcInstrItemList(dto);
    }


    @ApiOperation("查询仪器及仪器大类以及质控项目父子结构")
    @GetMapping("/findInstrAndInstrItemTree")
    public Result findInstrAndInstrItemTree(CommonPageDto pageParam){
        return qcInstrItemService.findInstrAndInstrItemTree(pageParam);
    }
}
